﻿@using VipSoft.WebUtility
@using Webdiyer.WebControls.Mvc
@using VipSoft.Membership.Core.Entity
@model VipSoft.Web.Areas.VipSoft.Controllers.RoleDto 
@using System.Web.Mvc.Html
@{
    ViewBag.Title = "角色管理";
    Layout = "~/Areas/VipSoft/Views/Shared/_AdminLayout.cshtml";
}


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>编辑文章信息</title>
        
    @Html.Partial("AdminBase")
    

    <script src="@Url.Content("~/Scripts/ligerUI/js/core/base.js")" type="text/javascript"></script>
     
    <script src="@Url.Content("~/Scripts/ligerUI/js/plugins/ligerLayout.js")" type="text/javascript"></script>


    <script src="@Url.Content("~/Scripts/ligerUI/js/plugins/ligerGrid.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/ligerUI/js/plugins/ligerResizable.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/ligerUI/js/plugins/ligerDrag.js")" type="text/javascript"></script> 
    

    <script src="@Url.Content("~/Scripts/jquery.form.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Admin/VipSoft.Membership.Role.js")" type="text/javascript"></script>
    <script type="text/javascript">

        $(function () { 
            $("#layout1").ligerLayout({ leftWidth: 200 });
        });

    </script>
    <style type="text/css">
        body { padding: 5px; margin: 0; padding-bottom: 15px; }
        #layout1 { width: 100%; margin: 0; padding: 0; }
        .l-page-top { height: 80px; background: #f8f8f8; margin-bottom: 3px; }
        h4 { margin: 20px; }
    </style>
    
    
    
    <script type="text/javascript">
        
        var TreeDeptData = {
            Rows: [
            {
                id: '01', name: "企划部", remark: "1989-01-12",
                children: [
                {
                    id: '0101', name: "企划分部一", remark: "企划分部一"
                },
                {
                    id: '0102', name: "企划分部二", remark: "企划分部二", children:
                      [
                          { id: '010201', name: "企划分部二 A组", remark: "企划分部二 A组" },
                          { id: '010202', name: "企划分部二 B组", remark: "企划分部二 B组" }
                      ]
                },
                { id: '0103', name: "企划分部三", remark: "企划分部三" }
                ]
            },
            { id: '02', name: "研发部", remark: "研发部" },
            { id: '03', name: "产品部", remark: "产品部" }
            ]
        };
        



        var manager;
        $(function () {
            window['g'] =
                manager = $("#maingrid").ligerGrid({
                        columns: [
                            { display: '部门名', name: 'name', width: 250, align: 'left' },
                            { display: '部门标示', name: 'id', id: 'id1', width: 250, type: 'int', align: 'left' },

                            { display: '部门描述', name: 'remark', width: 250, align: 'left' }
                        ], width: '100%', pageSizeOptions: [5, 10, 15, 20], height: '97%',
                        allowHideColumn: false, rownumbers: true, colDraggable: true, rowDraggable: true, checkbox: true,
                        data: TreeDeptData, alternatingRow: false, tree: { columnName: 'name' }
                    }
                );
        });

    </script>
    

</head>
<body class="mainbody"> 
    <div id="divList">

        <form id="frmSubmit" method="post">
        <div class="navigation">首页 &gt; 类别管理 &gt; 类别列表</div>
        <div class="tools_box">
            <div class="tools_bar">
                @Html.IcoLink("保存", "Add", new { cid = @Request.RequestContext.RouteData.Values["cid"], mid = @Request.RequestContext.RouteData.Values["mid"] }, "add")

                <input type="submit" name="btnSubmit" value="提交保存" id="btnSave" class="btnSubmit" />

                <!--
                            Html.IcoLink("修改文章", "Add","edit") 
                            Html.IcoLink("批量删除", "Add","delete")
                            -->
            </div>
        </div>
        <div id="layout1">
            <div position="left"></div>
            <div position="center" title="标题">
                <div id="maingrid"></div> 
            </div>
        </div>
        <table class="tableList">
            <tr>
                <th style="width: 15px;"></th>
                <th style="width: 30px;">编号</th>
                <th style="width: 80px;">编码</th>
                <th style="width: 80px;">名称</th>
                <th>描述</th>
                <th style="width: 80px;">状态</th>
                <th style="width: 100px;"></th>
            </tr>

            @foreach (var item in Model.RoleList)
            {
                <tr>
                    <td class="tdCenter">
                        <input name="@item.ID" id="@item.ID" onclick="UnSelectAll('chkSelectAll')" type="checkbox" value="@item.ID"/>
                    </td>
                    <td class="tdCenter">
                        @item.ID
                    </td>
                    <td>
                        @item.Code
                    </td>
                    <td>
                        @item.Name
                    </td>
                    <td>
                        @item.Description
                    </td>
                    <td class="tdCenter">
                        @item.Status
                    </td>

                    <td class="tdCenter">
                        @Html.ActionLink("修改", "Add", new { id = item.ID })
                        @Ajax.ActionLink("删除", "Delete", new { id = item.ID }, new AjaxOptions { UpdateTargetId = "divList", Confirm = "确定删除该数据？", OnSuccess = "successed", HttpMethod = "Post" })
                    </td>
                </tr>
            }
        </table>

        <table class="tableList">
            <tr>
                <th style="width: 15px;"></th>
                <th style="width: 30px;">编号</th>
                <th style="width: 80px;">名称</th>
                <th>URL</th>
            </tr>

            @foreach (var item in Model.MenuList)
            {
                <tr>
                    <td class="tdCenter">
                        <input name="chkAccess" id="@item.ID" onclick="UnSelectAll('chkSelectAll')" type="checkbox" value="@item.ID"/>
                    </td>
                    <td class="tdCenter">
                        @item.ID
                    </td>
                    <td>
                        @item.Name
                    </td>
                    <td>
                        @item.Url
                    </td>
                </tr>
            }
        </table>

        </form>
    </div>
</body>
</html>
